﻿import bpy

import bmesh

 

def print_vert_details(selected_verts):
    num_verts = len(selected_verts)

    print("number of verts: {}".format(num_verts))

    print("vert indices: {}".format([id.index for id in selected_verts]))

 

def get_vertex_data(object_reference):

    bm = bmesh.from_edit_mesh(object_reference.data)

    selected_verts = [vert for vert in bm.verts if vert.select]

    print_vert_details(selected_verts)

 

object_reference = bpy.context.active_object

get_vertex_data(object_reference)